package ipdesk.model.analysis.dao;



import ipdesk.model.analysis.bean.AnalysisPromoteBean;
import ipdesk.model.analysis.bean.AnalysisSeminarBean;

import java.util.List;
import java.util.Map;

import com.ibatis.dao.client.DaoManager;
import com.opensymphony.xwork2.ActionContext;

import ecg.dao.DaoService;

public class AnalysisPromoteDao {
	
	private static AnalysisPromoteDao singleton;
		
	protected AnalysisPromoteDao(){}
	
	public static AnalysisPromoteDao getInstance()
	{
		if(singleton == null)
		{
			singleton = new AnalysisPromoteDao();
		}
		
		return singleton;
	}
	
	private DaoManager	manager	= DaoService.getInstance();
	private IAnalysisPromote analysisPromote 	= (IAnalysisPromote)manager.getDao(IAnalysisPromote.class, "ip_desk");
	
	ActionContext context = ActionContext.getContext();
	Map<String, String> session = (Map<String, String>)context.getSession();
	
	public List<AnalysisPromoteBean> getYears() throws Exception{
		
		List<AnalysisPromoteBean> getYears = analysisPromote.getYears();
		
		return getYears;
	}
	
	public List<AnalysisPromoteBean> getAnalysisPromoteList(String selectedYear) throws Exception{
		
		List<AnalysisPromoteBean> analysisPromoteList = analysisPromote.getAnalysisPromoteList(selectedYear);
		
		return analysisPromoteList;
	}
	
	public List<AnalysisPromoteBean> getAnalysisPromoteListByMonth(AnalysisPromoteBean analysisPromoteBean) throws Exception{
		List<AnalysisPromoteBean> analysisPromoteListByMonth = analysisPromote.getAnalysisPromoteListByMonth(analysisPromoteBean);
		return analysisPromoteListByMonth;
	}

}
